package logic

import (
	"context"
	"doctor-medicine-system/models/mysql"

	"doctor-medicine-system/doctorrpc/doctorrpc"
	"doctor-medicine-system/doctorrpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MedSupplyListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMedSupplyListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MedSupplyListLogic {
	return &MedSupplyListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 药品信息录入
func (l *MedSupplyListLogic) MedSupplyList(in *doctorrpc.MedSupplyListRequest) (*doctorrpc.MedSupplyListResponse, error) {
	// todo: add your logic here and delete this line
	
	var list []*doctorrpc.MedSupplyList
	list = mysql.MedSupplyList(mysql.DB, in.DoctorId)

	return &doctorrpc.MedSupplyListResponse{
		List: list,
	}, nil
}
